package com.fizzkai.p2p.mgrsite.controller;

import com.fizzkai.p2p.core.domain.LoginInfo;
import com.fizzkai.p2p.core.service.ILoginInfoService;
import com.fizzkai.p2p.core.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class LoginController {
    @Autowired
    private ILoginInfoService loginInfoService;

    
    @RequestMapping("/mgrLogin")
    @ResponseBody
    public Object mgrLogin(String username, String password){
        loginInfoService.login(username, password, LoginInfo.USERTYPE_MANAGER);
        return new AjaxResult("登陆成功");
    }

    @RequestMapping("/main")
    public String main(){
        return "main";
    }

    @RequestMapping("/myTest")
    public Object myTestX(){
        return new AjaxResult();
    }
}
